package com.service.impl;

import com.dao.TeamDao;
import com.entity.TD_Team;
import com.service.inte.TeamServiceInte;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeamServiceImpl implements TeamServiceInte {

    @Autowired
    private TeamDao teamDao;

    @Override
    public List<Object[]> getTeamByFd_TypeId(int typeId,int page) {
        return teamDao.getTitleByFd_TypeId(typeId,new PageRequest(page,10));
    }

    @Override
    public List<Object[]> getLunBo(int typeId){
        return teamDao.getLunBo(typeId);
    }

    @Override
    public TD_Team getDetail(int id){
        return teamDao.getDetail(id);
    }

    @Override
    public List<Object[]> getRollByFatherType(int fatherType) {
        return teamDao.getRollByFatherType(fatherType);
    }

    @Override
    public List<Object[]> getTypeByCreateTimeDesc(int typeId, int page) {
        return teamDao.getTypeByCreateTimeDesc(typeId,PageRequest.of(page,10));
    }
}
